﻿<phone:PhoneApplicationPage x:Class="WPNEXT.ExplodeWallPage"
                            xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
                            xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
                            xmlns:Cmd="clr-namespace:GalaSoft.MvvmLight.Command;assembly=GalaSoft.MvvmLight.Extras.WP71"
                            xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
                            xmlns:i="clr-namespace:System.Windows.Interactivity;assembly=System.Windows.Interactivity"
                            xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
                            xmlns:phone="clr-namespace:Microsoft.Phone.Controls;assembly=Microsoft.Phone"
                            xmlns:shell="clr-namespace:Microsoft.Phone.Shell;assembly=Microsoft.Phone"
                            xmlns:WPNext="clr-namespace:WPNextTools.NControls;assembly=WPNextTools"
                            d:DesignHeight="768"
                            d:DesignWidth="480"
                            DataContext="{Binding Explode,
                                                  Source={StaticResource Locator}}"
                            FontFamily="{StaticResource PhoneFontFamilyNormal}"
                            FontSize="{StaticResource PhoneFontSizeNormal}"
                            Foreground="{StaticResource PhoneForegroundBrush}"
                            Orientation="Portrait"
                            shell:SystemTray.IsVisible="True"
                            mc:Ignorable="d">

    <!--  LayoutRoot is the root grid where all page content is placed  -->
    <Grid x:Name="LayoutRoot" Background="White">
        <Grid.RowDefinitions>
            <RowDefinition Height="0.9*" />
            <RowDefinition Height="0.1*" />
        </Grid.RowDefinitions>

        <WPNext:ExplodePhotoListBox x:Name="MyStreatWall"
                                    DeleteIcon="/Images/IconBtn/kd_mystreet_delete.png"
                                    EmptyContent="没有数据...."
                                    ExplodeMp3="/Asserts/mono-chimes.mp3"
                                    ExplodeSourceFolder="/Images/Effect/"
                                    HeaderContent="松开可以刷新..."
                                    ItemsSource="{Binding Items}"
                                    Loading="{Binding Loading}"
                                    LoadingContent="加载中...">
            <WPNext:ExplodePhotoListBox.ItemTemplate>
                <DataTemplate>
                    <Grid Background="Gray">
                        <Image Source="{Binding Url}" />
                    </Grid>
                </DataTemplate>
            </WPNext:ExplodePhotoListBox.ItemTemplate>
            <WPNext:PhotoListBox.StrategyDefinition>
                <WPNext:ExplodeStrategyDefinition ColumnCount="3"
                                                  ColumnMargin="5"
                                                  LeftRightMargin="20"
                                                  Orientation="Vertical" />
            </WPNext:PhotoListBox.StrategyDefinition>
            <i:Interaction.Triggers>
                <i:EventTrigger EventName="ExpoldItemRemove">
                    <Cmd:EventToCommand Command="{Binding ExplodItemRemoveCommand, Mode=OneWay}" CommandParameter="{Binding Path=SelectedItem, ElementName=MyStreatWall}" />
                </i:EventTrigger>
                <i:EventTrigger EventName="ScrolledToBottom">
                    <Cmd:EventToCommand Command="{Binding GetDataCommand}" />
                </i:EventTrigger>
                <i:EventTrigger EventName="StretchedFromTop">
                    <Cmd:EventToCommand Command="{Binding RefreshCommand}" />
                </i:EventTrigger>
                <i:EventTrigger EventName="ItemTap">
                    <Cmd:EventToCommand Command="{Binding ItemTapCommand}" CommandParameter="{Binding Path=SelectedItem, ElementName=MyStreatWall}" />
                </i:EventTrigger>
            </i:Interaction.Triggers>
        </WPNext:ExplodePhotoListBox>

        <Grid Grid.Row="1">
            <Grid.ColumnDefinitions>
                <ColumnDefinition />
                <ColumnDefinition />
                <ColumnDefinition />
                <ColumnDefinition />
                <ColumnDefinition />
            </Grid.ColumnDefinitions>

            <Button Grid.Column="0"
                    Background="Black"
                    Command="{Binding AddToTopCommand,
                                      Mode=OneWay}"
                    Content="AddToTop"
                    Foreground="White" />
            <Button Grid.Column="1"
                    Background="Black"
                    Command="{Binding SetToNullCommand}"
                    Content="Null"
                    Foreground="White" />
            <Button Grid.Column="2"
                    Background="Black"
                    Command="{Binding DeleteSelectCommand}"
                    Content="DeleteSelect"
                    Foreground="White" />
            <Button Grid.Column="3"
                    Background="Black"
                    Command="{Binding RefreshCommand}"
                    Content="LoseFocus"
                    Foreground="White" />
            <Button x:Name="GoTo"
                    Grid.Column="4"
                    Background="Black"
                    Click="GoTo_Click"
                    Content="Go"
                    Foreground="White" />
        </Grid>

        <!--  TitlePanel contains the name of the application and page title  -->

        <!--  ContentPanel - place additional content here  -->
    </Grid>
</phone:PhoneApplicationPage>